package com.dyz.wsw.front.market.dao.persist.repository;

import com.dyz.wsw.front.market.pojo.entity.MarketCard;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

/**
 * @author dyz
 * @date 2025/1/15 0:37
 */
@Repository
public interface MarketCardRepository extends R2dbcRepository<MarketCard, Long> {

    @Query("SELECT * FROM market_card ORDER BY RAND() LIMIT :count")
    Flux<MarketCard> findRandCards(Integer count);
}
